/**
 * 
 */
package messy.annotation;

/**
 * @author admin
 *
 */
public class Fruit {

	@TestAnno("apple")
	private String fruitName;

	@TestAnno("a-p-p-l-e")
	private String frutiCode;

	public String getFruitName() {
		return fruitName;
	}

	public void setFruitName(String fruitName) {
		this.fruitName = fruitName;
	}

	public static void main(String[] args) throws Exception {
		Fruit fruit = new Fruit();
		TestAnno testAnno = fruit.getClass().getDeclaredField("frutiCode").getAnnotation(TestAnno.class);
		if (testAnno != null) {
			System.out.println(testAnno.value());
		} else {
			System.out.println("该属性上没有加TestAnno注解!");
		}
	}

}
